1. Field of the Invention
The present invention relates to a system and method for mapping a design model defining a problem space to a common repository accessible to application development tools in a manner that preserves contextual information of the model constructs and their properties.
2. Description of the Related Art
In object oriented analysis, design, and programming schemes, software developers define not only the data type of a data structure, but also the types of operations (functions) that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. Objects are abstract data types that define a real world entity to be manipulated and operated on within the object oriented programming environment. The functions included in an object are referred to as methods. In addition, programmers can define relationships among objects. Object-oriented programming techniques allow developers to create reusable modules that can interface and work with new objects added to the design. For instance, new objects can be made compatible with the current objects by having the new object inherit properties from existing objects. Object oriented programming languages include JAVA(trademark), Smalltalk, and C++. JAVA is a trademark of Sun Microsystems, Inc.
An interface is a set of operations associated with an object that is used to access and manipulate the functions in the object. The interface operations are the only way to operate and affect the data for the abstract data type (object). Objects are further defined according to xe2x80x9cclass,xe2x80x9d which is an actual representation of an abstract data type, providing the properties and methods associated with the object. Instances of classes are called objects. An object instance of a class includes actual values for the data properties of the class. For instance, a class Employee may define attributes for an individual person, such as the name and social security number. In such case, an instance of the class employee includes the data for a particular employee. The behavior of an object refers to the methods or operations that apply to the data in the object.
Another object oriented concept is inheritance. Inheritance is the mechanism which allows an object of a certain class to inherit properties of another class. An object may inherit both the attributes and methods from another class. For instance, if class A inherits from class B, then B is called superclass of A; A is a subclass of B. Objects of a subclass can be used where objects of the corresponding superclass are expected.
Developers initially design an object oriented model using visual modeling tools that employ a graphical user interface (GUI). Visual modeling tools often support the unified modeling language (UML). Visual modeling tools include RATIONAL ROSE(trademark), ERWIN, and the Microsoft Visual Modeler. RATIONAL ROSE is a trademark of Rational Software; ERWIN(copyright) is a registered trademark of Logic Works, Inc. FIGS. 1a and 1b illustrate a graphical interface from the Rational Rose modeling tool displayed on a computer terminal. The GUI displays the model constructs (e.g., submodels, classes, attributes, methods, class relationships, etc.) which make up the object-oriented model.
After the developer uses a visual modeling tool to model the object oriented environment, the design model may be converted to a common repository accessible to application development tools, which developers may use to modify and manipulate the object environment. International Business Machines Corporation (IBM), the assignee of the present patent application, provides the Component Broker product that includes bridge technology to transfer files from a visual modeling tool, such as Rational Rose, to a metadata format accessible to the IBM Object Builder program. The common repository maintains the metadata in a file.
FIGS. 1a and 1b illustrate two models, Model 1 and Model 2, displayed in the GUIs 2a, b of a visual modeling tool. These models have same named constructs, which in the example are same named classes, including Person, Car, and Truck. However, the same named constructs are defined with different method and data attributes in the different models. For instance, the Car object 4a in Model 1 has different data attributes and methods than the Car object 4b in Model 2. The Person 6a, b, Truck 8a, b, and Minivan 10a, b objects also have different attributes in Models 1 and 2.
Once the developer designs an object oriented model using a visual modeling tool, the model information must be mapped to the repository accessible to the application development tools. Current mapping techniques store the design information in a model file containing a subset or complete set of the model information. Unique named and same named model elements may be imported from different models into the common respository. One problem is that current mapping conventions do not maintain contextual information distinguishing classes having the same name in different models. With current mapping techniques, the attributes, properties, and relationships of classes in different models with the same name are stored under a single name interface for the class which combines the attributes from all the same named classes from the different models into a single class. Thus, current mapping methodologies do not distinguish class properties according to model or some other logical grouping of classes. For instance, two developers may define two different models including the identical class names, such as shown in FIGS. 1a, b. Current mapping techniques map the properties of the same named classes to a single class construct in the common repository, thereby losing all the distinctions for the class provided by the developers in their different models. Thus, with current mappings, the model context is lost when classes within different models have the same name.
FIG. 2 illustrates a GUI 12 that displays the results of mapping the design model data to the common repository with the current IBM Object Builder application development tool. Panel 14 in the GUI 12 shows that all the properties for class Car within both Models 1 and 2 have been mapped into a single class Car. By mapping the properties from classes having the same name in different models that have different properties, current mapping techniques eliminate the uniqueness of class properties (e.g., attributes and methods) between models. Current techniques, thus, effectively destroy the solution the developer provided to the real-world problem within the particular model.
To overcome the limitations in the prior art described above, the present invention discloses a system for mapping objects defined in a design model to a common repository. A design model is provided that includes at least two models. A first model includes a first class and a second model includes a second class. The first class and second class have the same name, and the first class and second class have at least one different attribute and method. The first model, the first class, and attributes and methods therein are mapped to a first data structure that indicates that the first class is included with the first model. The second model, the second class, and attributes and methods therein are mapped to a second data structure that indicates that the second class is included with the second model. In this way, the first class and the second class are distinguished according to their model in the data structures.
Preferred embodiments provide a method for mapping design data defining objects in a modeling language such as UML to a common repository that is accessible to application development tools. With preferred embodiments, the mapping preserves distinctions in classes having the same name in different models. In particular, if classes located in separate models have the same name, then the preferred mapping would preserve the model context of the classes, including the method, attribute, and relationship distinctions for the same named model. In this way, the user definitions of a class and, hence, the initial modeling of the real-world problem is preserved. Moreover, preferred embodiments provide an improved GUI to view and better understand the layout of the initial design by displaying how classes with the same name belong to different models.